<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output indent="yes" method="html"/>
        <xsl:template match="/*/com.transcargo.distance.Distance">
            Маршрут <b><xsl:value-of select="startCity"/></b> - <b><xsl:value-of select="endCity"/></b><br/>
	    Расстояние: <b><xsl:value-of select="totalDistance"/> км.</b><br/>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <tr>
                <th>Пункт</th>
                <th>Трасса</th>
                <th>Расстояние от начала</th>
                <th>Длина участка</th>
                <th>&#160;</th>
            </tr>
            <xsl:apply-templates select="Road/com.transcargo.distance.Distance_-road"/>
            </table><br/>
        </xsl:template>

        <xsl:template match="com.transcargo.distance.Distance_-road">
		<xsl:if test="pointType=11"><xsl:choose><xsl:when test="not(roadType=0)">
					    <tr bgcolor="#ffffff"><td>&#160;</td>
					    <td><img><xsl:attribute name="src">img/road<xsl:value-of select="roadType"/>.gif</xsl:attribute></img></td>
					    <td colspan="3" align="right"><b><xsl:value-of select="point"/></b></td></tr>
					    <tr bgcolor="#ff9999" height="3"><td colspan="5"></td></tr>
					    </xsl:when><xsl:otherwise>
						<tr><td colspan="5" align="right"><b><xsl:value-of select="point"/></b></td></tr>
					    </xsl:otherwise></xsl:choose></xsl:if>
		<xsl:if test="pointType=10"><tr bgcolor="#999999" height="3"><td colspan="5"></td></tr>
					    <tr bgcolor="#ffffff"><td>&#160;</td>
					    <td><img><xsl:attribute name="src">img/road<xsl:value-of select="roadType"/>.gif</xsl:attribute></img></td>
					    <td colspan="3" align="right"><xsl:value-of select="point"/></td></tr></xsl:if>
		<xsl:if test="pointType &lt; 10"><tr bgcolor="#ffffff"><td><xsl:value-of select="point"/></td>
						<td><img><xsl:attribute name="src">img/road<xsl:value-of select="roadType"/>.gif</xsl:attribute></img></td>
						<td><xsl:value-of select="distanceLong"/></td>
						<td><xsl:value-of select="distance"/></td>
						<td>&#160;</td></tr>
		</xsl:if>
    </xsl:template>
</xsl:stylesheet>
